package com.wm.wmcrm.common.result;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wm.wmcrm.sys.entity.SysUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.context.SecurityContextHolder;

public class CurrentUsername {
    public static String getCurrentUsername(){
        UsernamePasswordAuthenticationToken token = (UsernamePasswordAuthenticationToken) SecurityContextHolder
                .getContext().getAuthentication();
        return (String) token.getPrincipal();

    }
}
